﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace End_term
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {//添加
            Form2 form2 = new Form2();
            var title = textBox1.Text.Trim();
            var articles = textBox2.Text.Trim();
            var insert = string.Format("insert into Articles(Title,Author)" +
                " values('{0}','{1}')",title,articles);
           Dbhelp.GetDataTable(insert);
            MessageBox.Show("添加成功");
            this.DialogResult = DialogResult.Yes;
            this.Close();
            
            


        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
